﻿using System;
namespace Velocity4Net.Util.Introspection
{
    /**
     *  Interface defining a 'getter'.  For uses when looking for resolution of
     *  property references
     *
     *       $foo.bar
     *
     * @author <a href="mailto:geirm@optonline.net">Geir Magnusson Jr.</a>
     * @version $Id: VelPropertyGet.java 463298 2006-10-12 16:10:32Z henning $
     */
    public interface VelPropertyGet
    {
        /**
         *  invocation method - called when the 'get action' should be
         *  preformed and a value returned
         * @param o
         * @return The resulting Object.
         * @throws Exception
         */
        Object invoke(Object o);

        /**
         *  specifies if this VelPropertyGet is cacheable and able to be
         *  reused for this class of object it was returned for
         *
         *  @return true if can be reused for this class, false if not
         */
        bool isCacheable();

        /**
         *  returns the method name used to return this 'property'
         * @return The method name used to return this 'property'
         */
        String getMethodName();
    }
}